clear all 
clc 
close all

Rorb=191e+5;
Rl=6371e+3;
w=(2*pi)/(12*3600);
T=60;
tmax=12*3600;
t=0:T:tmax;
N=length(t);
Rr=[0;Rl];
fo=1602e+6;
c=3e+8;
for k=1:N;
    Rsat=Rl+Rorb;
    Rsv=[Rsat*cos(w*t(k)); Rsat*sin(w*t(k))];
    Rsvmas(:,k)=Rsv;
    Rv=Rsv-Rr;
    Rvmas(:,k)=Rv;
    if k>2
    Vsv(:,k)=(Rsvmas(:,k)-Rsvmas(:,(k-1)))/T;
    Vv(:,k)=dot(Vsv(:,k),Rvmas(:,k))/norm(Rvmas(:,k));
    fd(:,k)=(Vv(:,k)*fo)/c;
    end;
end;
figure(1);
plot(Rsvmas(1,:),Rsvmas(2,:));
figure(2);
plot(Rvmas(1,:),Rvmas(2,:));
figure(3)
plot(t,fd);